# 令SRC_LIST获得依赖server目录下的所有源文件
aux_source_directory(. SRC_LIST)
aux_source_directory(./db DB_LIST)
aux_source_directory(./Model MODEL_LIST)
aux_source_directory(./redis REDIS_LIST)



# 指定可执行文件
add_executable(ChatServer.exe ${SRC_LIST} ${DB_LIST} ${MODEL_LIST} ${REDIS_LIST})


#find_library(MYSQL_SO mysqlclinet PATHS /usr/lib64/mysql)

find_library(HIREDIS_LIB hiredis)
if (NOT HIREDIS_LIB)
    message(FATAL_ERROR "hiredis library not found. Please install hiredis.")
endif()


#注意 moduo_core本身依赖线程库，所以它放在前面
target_link_libraries(ChatServer.exe muduo_core mysqlclient pthread ${HIREDIS_LIB})



